<div class="dcjq-accordion" id="dc_jqaccordion_widget-2-item">
            <ul id="menu-cat" class="menu">
                <?php foreach($categories as $category){ ?>
                <?php if($category['children']){ ?>
                <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php echo $category['category_id']; ?> dcjq-parent-li">
                    <a id="<?php echo $child['category_id']; ?>" href="<?php echo $category['href']; ?>" class="dcjq-parent">
                        <?php echo $category['name']; ?>
                        <span class="dcjq-icon"></span>
                    </a>
                    <ul class="sub-menu" style="display: none;">
                        <?php foreach($category['children'] as $child){ ?>
                        <?php if($child['children']) { ?>
                            <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php echo $child['category_id']; ?>">
                                <a id="<?php echo $child['category_id']; ?>" href="<?php echo $child['href']; ?>" style="font-style: normal; font-size: 12px; color: #9f3946 !important; padding-left: 29px;">
                                    <img class="sarrow" src="image/grey-marker-closed.png" id="subarrow-<?php echo $child['category_id']; ?>" class="subarrow" />
                                    <?php echo $child['name']; ?>
                                    <!-- <span class="dcjq-icon"></span> -->
                                </a>
                                    <ul class="sub-menu" style="display: none;">
                                        <?php foreach($child['children'] as $value){ ?>
                                        <?php if($value['children']) { ?>
                                        <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php echo $value['category_id']; ?>">
                                            <a id="<?php echo $value['category_id']; ?>" href="<?php echo $value['href']; ?>" style="font-style: normal; font-size: 12px; color: #9f3946 !important; padding-left: 50px;">
                                                <img class="sarrow" src="image/grey-marker-closed.png" id="subarrow-<?php echo $value['category_id']; ?>" class="subarrow" />
                                                <?php echo $value['name']; ?>
                                            </a>
                                            <ul class="sub-menu" style="display: none;">
                                                <?php foreach($value['children'] as $last_level) { ?>
                                                <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php echo $last_level['category_id']; ?>">
                                                    <a id="<?php echo $last_level['category_id']; ?>" href="<?php echo $last_level['href']; ?>" style="font-style: normal; font-size: 11px; color: #80242f !important; padding-left: 71px;">
                                                        <?php echo $last_level['name']; ?>
                                                    </a>
                                                </li>
                                                <?php } ?>
                                            </ul>
                                        </li>
                                        <?php } else { ?>
                                            <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php echo $value['category_id']; ?>">
                                                <a id="<?php echo $child['category_id']; ?>" href="<?php echo $value['href']; ?>" style="font-style: normal; font-size: 11px; color: #80242f !important; padding-left: 50px;">
                                                    <?php echo $value['name']; ?>
                                                </a>
                                            </li>
                                        <?php } ?>
                                        <?php } ?>
                                    </ul>
                            </li>
                        <?php } else { ?>
                            <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php echo $child['category_id']; ?>">
                                <a id="<?php echo $child['category_id']; ?>" href="<?php echo $child['href']; ?>" style="font-style: normal; font-size: 12px; color: #9f3946 !important; ">
                                    <?php echo $child['name']; ?>
                                </a>
                            </li>
                        <?php } ?>
                        <?php } ?>
                    </ul>
                </li>
                <?php }else{ ?>
                    <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php echo $category['category_id']; ?>">
                        <a id="<?php echo $child['category_id']; ?>" href="<?php echo $category['href']; ?>">
                            <?php echo $category['name']; ?>
                        </a>
                    </li>
                <?php } ?>
                <?php } ?>
            </ul>		
        </div>